//#pragma comment(linker,"/STACK:16777216") /*16Mb*/
//#pragma comment(linker,"/STACK:33554432") /*32Mb*/
#define _CRT_SECURE_NO_DEPRECATE
#include<iostream>
#include<numeric>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<memory>
#include<string>
#include<vector>
#include<cctype>
#include<list>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<algorithm>
using namespace std;

typedef unsigned long long      ui64;
typedef long long               i64;
typedef	vector<int>             VI;
typedef	vector<bool>            VB;
typedef	vector<VI>              VVI;
typedef	vector<string>          VS;
typedef	pair<int,int>           PII;
typedef map<string,int>         MSI;
typedef set<int>                SI;
typedef set<string>             SS;
typedef map<int,int>            MII;
typedef	pair<double,double>     PDD;

#define PB                      push_back
#define MP                      make_pair
#define X                       first
#define Y                       second
#define FOR(i, a, b)            for(int i = (a); i < (b); ++i)
#define RFOR(i, a, b)           for(int i = (a) - 1; i >= (b); --i)
#define CLEAR(a, b)             memset(a, b, sizeof(a))
#define SZ(a)                   int((a).size())
#define ALL(a)                  (a).begin(), (a).end()
#define RALL(a)                 (a).rbegin(), (a).rend()
#define INF                     (2000000000)

int RES(VI a) {
	int res = 0;
	FOR(i,0,SZ(a)-1) 
		res += a[i]*a[i+1];
	return a.back() + res;
}

VI gen_min(int n) {
	if( n%2 ) {
		int left = 1;
		int right = n-1;
		VI res;
		while( left!=n && right!=1 ) {
			res.PB( left);
			res.PB( right);
			left+=2;
			right-=2;
		}
		res.PB(n);
		return res;
	}
	/*
	if( (n/2)%2 ) {
		int left = 1;
		int right = n-1;
		VI res;
		while( left < right ) {
			res.PB( left );
			res.PB( right );
			left += 2;
			right -= 2;
		}
		res.PB( right );
		left-=2;
		swap(left,right);
		left ++;
		right++;
		while( true ) {
			if( left <= 0 || left > n || right<=0 || right>n)
				break;
			if( left > 0 )
				res.PB( left );
			if( right <= n )
				res.PB( right );
			
			left +=2;
			right-=2;
			
		}
		cout << ":";
		return res;
	}*/

	int left = 1;
	int right = n-1;
	VI res;
	while( left < right ) {
		res.PB( left );
		res.PB( right );
		left += 2;
		right -= 2;
	}
	if( (n/2)%2 ) {
		res.PB( right );
		left-=2;
	}

	

	swap(left,right);
	left ++;
	right++;
	while( true ) {
		if( left <= 0 || left > n || right<=0 || right>n)
			break;
		if( left > 0 )
			res.PB( left );
		if( right <= n )
			res.PB( right );
		
		if( (n/2)%2 ) {
			left +=2;
			right-=2;
		}
		else{
		left -= 2;
		right += 2;
		}
	}
	if( (n/2)%2 )
		res.PB( n );
	return res;

}

int main()
{
	int n;
	cin >> n;

	if( n<=0 ) {
		VI pr2(n);
		FOR(i,0,n) pr2[i] = i+1;
		VI res2;
		int Res2 = INF;
		do{
			if( pr2[0]!=1 )
				break;
			int t = RES(pr2);
			if( Res2 > t ) {
				Res2 = t;
				res2 = pr2;
			}
		}while(next_permutation(ALL(pr2)));

		//cout << Res2 << endl;
		FOR(i,0,n)
			printf("%d%c",res2[i],i==n-1?'\n':' ');
	}
	//else
	{
		VI a;
		/* build A */
		//cout << "ads\n";
		a = gen_min(n);
		FOR(i,0,n)
			printf("%d%c",a[i],i==n-1?'\n':' ');
	}
	
	VI b;
	/* build B */
	if( n<=7 ) {
		VI pr(n);
		FOR(i,0,n) pr[i] = i+1;
		VI res;
		int Res = 0;
		do{
			int t = RES(pr);
			if( Res < t ) {
				Res = t;
				res = pr;
			}
		}while(next_permutation(ALL(pr)));

		//cout << Res << endl;
		FOR(i,0,n)
			printf("%d%c",res[i],i==n-1?'\n':' ');
		return 0;
	}

	int it1 = 2;
	int rise = 1;
	b.PB( 1 );
	while( true ) {
		b.PB(it1);
		if( it1==3 )
			break;
		if( it1 == n-1 ) {
			it1++;
			b.PB( it1 );
			rise=-1;
		}
		if( it1 == n && rise == 1) {
			it1--;
			b.PB( it1 );
			it1-=2;
			b.PB(it1);
			rise = -1;
		}
		it1 += rise*2;
	}

	//FOR(i,0,n) printf("%d%c",a[i],i==n-1?'\n':' ');
	//cout << RES(b) << endl;
	FOR(i,0,n)
		printf("%d%c",b[i],i==n-1?'\n':' ');
    return 0;
}